﻿@{
    ViewBag.Title = "Semester Info - Project Management System";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>
    Semester Info</h2>
<form id="form" action="" method="post">
<div class="content-box" id="User">
    <!-- Start Content Box -->
    <div class="content-box-header">
        <h3>
            Semester Info
        </h3>
        <div class="clear">
        </div>
    </div>
    <!-- End .content-box-header -->
    <div class="content-box-content">
        @{ if (TempData["Message"] != null)
           {
            <div class="notification png_bg" id="messageBox">
                <a href="#" class="close">
                    <img src="../../Content/images/icons/cross_grey_small.png" title="Close this notification"
                        alt="close" /></a>
                <div>
                    @TempData["Message"].ToString()
                </div>
            </div>
           }
        }
        <fieldset>
            <input type="hidden" id="txtSemesterID" name="SemesterID"value="@Model.SemesterID"/>
            <p>
                <label class="width12 floatLeft">
                    Semester Name:</label>
                <input type="text" id="txtSemesterName" name="SemesterName" class="width20 medium-input input-inline text-input" value="@Model.SemesterName"/>
            </p>
            <p>
                <label class="width12 floatLeft">
                    From Date:</label>
                <input type="text" id="txtFromDate"  onchange="javascript:$('#htxtFromDate').val(formatDate(this.value));" class="DateTime width20 input-inline text-input" value="@Model.FromDate.ToString("dd/MM/yyyy")"  />
                <input type="hidden" id="htxtFromDate" name ="FromDate"  value="@Model.FromDate.ToString("yyyy/MM/dd")"/>
            </p>
            <p>
                <label class="width12 floatLeft">
                    To Date:</label>
                <input type="text" id="txtToDate"  onchange="javascript:$('#htxtToDate').val(formatDate(this.value));"  class="DateTime width20 input-inline text-input" value="@Model.ToDate.ToString("dd/MM/yyyy")"  />
                <input type="hidden" id="htxtToDate" name ="ToDate"  value="@Model.ToDate.ToString("yyyy/MM/dd")"/>
            </p>
            <p>
                <input class="button" type="submit" value="Save" id="btnSubmit" />
            </p>
        </fieldset>
    </div>
</div>
</form>
<script type="text/javascript">
    $("#Setting").addClass("current");
    $("#ManageSemester").addClass("current");


    $(".DateTime").datepicker({
        dateFormat: 'dd/mm/yy',
        gotoCurrent: true,
        changeMonth: true,
        changeYear: true,
        showStatus: true,
        showWeeks: true,
        highlightWeek: true,
        numberOfMonths: 1,
        showButtonPanel: true,
        hideIfNoPrevNext: true,
        showAnim: "scale",
        showOptions: {
            origin: ["top", "left"]
        }
    });



    $(".DateTime").filter_inputDateTime(DateTimeFormat);

    function formatDate(dateObj) {
        var date = dateObj;
        var datearray = date.split("/");
        return datearray[2] + '/' + datearray[1] + '/' + datearray[0];
    }
</script>
